package org.jeecg.modules.operations.assistant.xcbd.service;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;
public class OrderNumberGenerator {
    private static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
    private static final Random random = new Random();

    public static String generateOrderNumber() {
        // 获取当前日期时间的字符串表示
        String datePortion = dateFormat.format(new Date());
        // 生成一个三位随机数
        int randomNumber = 100 + random.nextInt(900); // 保证随机数是三位数
        // 拼接字符串
        return datePortion + randomNumber;
    }
}
